Skip to content

feat(odoo-spo): regenerate corpus with inherits_from + validation_kind (#526 follow-up)#527

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/odoo-spo-corpus-regen
Jun 18, 2026
Merged

feat(odoo-spo): regenerate corpus with inherits_from + validation_kind (#526 follow-up)#527
AdaWorldAPI merged 1 commit into
mainfrom
claude/odoo-spo-corpus-regen

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Executes the one explicit pending step from #526: "Corpus regenerated against live /home/user/odoo/addons — pending next session with Odoo source." #526 shipped the inherits_from (ruff#19) + validation_kind (ruff#21) enrichment passes as code, but the shipped corpus carried none of their triples because that session lacked the Odoo source tree. This session has /home/user/odoo/addons, so the two passes now land their data in the shipped corpus.

What changed

Regenerated the corpus through the merged four-pass spo_enrich. The pass is additive and (s,p,o)-idempotent, so re-running over the already-enriched corpus added only the genuinely new predicates:

pass new triples
P1 target / inverse_name 0 (already present)
P0 deep reads_field 0 (already present)
P1b inherits_from (ruff#19) 166
P2 validation_kind (ruff#21) 247

24 166 → 24 579. The P1/P0 zero-delta confirms #525's inherit[0] fix and the multi-emitter deep-read lifts are already baked into the corpus (no drift).

validation_kind distribution: presence 108 / range 80 / lookup 31 / uniqueness 18 / format 10.

Rust (crates/lance-graph/src/graph/spo/odoo_ontology.rs)

  • count assertion 24_16624_579
  • histogram now asserts inherits_from = 166 and validation_kind = 247
  • module-doc provenance + counts updated
  • 2 new regression tests:
    • enrichment_emits_inherits_from_to_declared_baseaccount_account inherits_from mail_thread; asserts every inherits_from base is a corpus-declared ogit:ObjectType and no edge is a self-loop (the Odoo extend-in-place idiom is dropped at scan time).
    • enrichment_emits_validation_kind_on_constrains_method_check_account_code classified format; asserts every object ∈ {presence, uniqueness, range, format, lookup}.

Tests

Consumer follow-up (separate, on AdaWorldAPI/odoo-rs)

od_ontology::RecomputeDag and a future ClassView MRO walk now see the 166 inheritance edges. The odoo-rs UPSTREAM_WISHLIST P1 (_inherit / _inherits) + P2 (validation_kind) become upstream-resolved once a consumer PR picks them up. No odoo-rs change here (one-way pull).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added new enrichment predicates (inherits_from and validation_kind) to enhance inheritance and validation tracking within the corpus.
    • Expanded corpus coverage with regenerated data totaling 24,579 triples.
  • Tests

    • Added regression tests to verify enrichment outputs and validate ontology data integrity.
  • Documentation

    • Updated corpus documentation with new enrichment statistics and coverage metrics.

#526 follow-up)

PR #526 shipped the inherits_from (ruff#19) + validation_kind (ruff#21)
enrichment passes as code, but left the corpus regen pending — that session
lacked the Odoo source tree. This session has /home/user/odoo/addons, so the
two passes now land their triples in the shipped corpus.

Regenerated via the merged spo_enrich (additive, (s,p,o)-idempotent):
  P1/P0           0 new (already present; #525 inherit[0] + multi-emitter baked in)
  inherits_from 166 new
  validation_kind 247 new
  24166 -> 24579

odoo_ontology.rs: count 24_166 -> 24_579; histogram gains inherits_from=166 +
validation_kind=247; module doc updated; 2 new regression tests
(enrichment_emits_inherits_from_to_declared_base,
 enrichment_emits_validation_kind_on_constrains_method).

cargo test -p lance-graph --lib odoo_ontology 13/13 green; fmt clean;
python3 -m unittest tests.test_spo_enrich 41/41 (no python change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8dc314ce-0780-4d39-a75b-1ee4eea6307d

📥 Commits

Reviewing files that changed from the base of the PR and between 01b9509 and 05606dc.

📒 Files selected for processing (3)
  • .claude/board/AGENT_LOG.md
  • crates/lance-graph/src/graph/spo/odoo_ontology.rs
  • crates/lance-graph/src/graph/spo/odoo_ontology.spo.ndjson

📝 Walkthrough

Walkthrough

Appends 413 SPO NDJSON triples to the Odoo ontology corpus introducing inherits_from and validation_kind enrichment predicates across accounting, HR, mail, product, project, purchase, sales, stock, and website models. Rust module documentation is updated to the new 24,579-triple total, existing count/histogram tests are adjusted, and two new regression tests verify the enrichment emissions.

Changes

Odoo SPO Corpus Enrichment and Test Alignment

Layer / File(s) Summary
New inherits_from and validation_kind NDJSON triples
crates/lance-graph/src/graph/spo/odoo_ontology.spo.ndjson
413 new triples appended covering mixin inheritance edges and @api.constrains validation-kind links across all major Odoo subsystems.
Rust ontology test updates and module doc revision
crates/lance-graph/src/graph/spo/odoo_ontology.rs
Module docs updated to 24,579 total. Existing parses_all_triples and predicate_histogram_matches_extraction tests realigned; two new tests added for inherits_from edge correctness and validation_kind recognized-set membership.
AGENT_LOG run record
.claude/board/AGENT_LOG.md
Dated log entry prepended recording the enrichment tool run, new predicates, idempotent behavior, and future DAG/MRO consumer impact.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AdaWorldAPI/lance-graph#525: Introduced spo_enrich.py fixes for deep reads_field and _inherit-only models that directly produced the enriched corpus and Rust test baseline this PR updates.

Poem

🐇 Hop, hop through the triples I go,
inherits_from edges all in a row,
validation_kind stamped with care,
24,579 triples beyond compare!
The corpus grows, the tests all pass—
This rabbit's enrichment built to last. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change: regenerating the SPO corpus with two new enrichment predicates (inherits_from and validation_kind), which is clearly the primary focus of all file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AdaWorldAPI AdaWorldAPI merged commit ca810e5 into main Jun 18, 2026
6 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 18, 2026
…d Core, harvest is subordinate

Repurposes the P3 selection_value work after the operator caught a real
architectural inversion: the wishlist's structural asks (target /
inverse_name / inherits_from / selection_value) are CORE facts, not
behavioural harvest, and belong in the typed `OdooEntity` Core
(`lance-graph-ontology::odoo_blueprint`) — not bolted onto the flat SPO
ndjson by `spo_enrich.py`.

Source-verified: `OdooField.target` ALREADY exists in the Core, so the
`target` harvest pass was re-deriving a fact the Core already held;
`inherits_from` + `selection_value` were genuine Core gaps filled on the
harvest side — the "Core gap → extend the Core deliberately, never hack
the adapter" anti-pattern.

# Why a side-table, not a struct field

`OdooField` has 3 554 literal sites, `OdooEntity` 404, no constructor.
Adding a field to the mega-structs breaks every literal. The
doctrine-correct "extend the Core deliberately" for a literal sea that
size is a TYPED SIDE-TABLE — still Core, still authoritative, beside the
mega-structs instead of inside them.

# What lands

New `odoo_blueprint/structural.rs`:
  - `OdooInherits { model, bases }` — the _inherit/_inherits mixin chain
    (OdooEntityKind records the ORM base class, not the mixin list)
  - `OdooFieldSelection { model, field, values }` — Selection value domain
    (OdooFieldKind::Selection flags it; OdooField never stored the values)
  - Curated `account.move` consts, GROUNDED: INHERITS matches the #527
    corpus (mail_activity_mixin + sequence_mixin); FIELD_SELECTIONS uses
    canonical standard Odoo state/move_type value sets.
  - `project_inherits_from` / `project_selection_value` — Core → SPO
    projection (direction of truth: Core out to SPO, never the reverse).
  - 5 tests incl. a consistency check against the #527 corpus.

# Reframing (anti-self-fulfilling-drift)

So a future session does NOT read the prior work as "add another
spo_enrich predicate":

  - `spo_enrich.py` module-doc gains an ARCHITECTURE NOTE: the structural
    predicates' authoritative home is the typed Core; this file is the
    Extracted-leg BREADTH feeder for the ~322 ObjectTypes the curated
    Core hasn't reached; Curated Core wins on convergence. Behavioural
    predicates (deep reads_field, emitted_by, validation_kind) ARE
    genuine harvest and correctly stay.
  - `EPIPHANIES.md` prepends E-ODOO-CORE-FIRST-STRUCTURAL, which
    explicitly BOUNDS THE FRAMING of the four prior E-ODOO-SPO-* entries
    so the predicate-bolt-on cadence isn't read as the intended
    architecture. Names `virtually_overrides` as a ClassView/Core
    capability — NOT harvest predicate #6.

# Not changed

The selection_value AST reader in spo_enrich.py stays (it's the Extracted
leg's mechanism for breadth) — now correctly subordinate to the Core.
Behavioural harvest is untouched.

# Tests

  cargo test -p lance-graph-ontology --lib structural : 5/5
  python3 -m unittest tests.test_spo_enrich            : 53/53
  cargo test -p lance-graph --lib odoo_ontology        : 13/13 (unchanged)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants